package com.java.reflect.proxy;
/**
 * 代理角色
 * @author BlueKey
 *
 */
public class ProxyRole extends AbstractRole {
	
	private RealRole realRole;
	
	public ProxyRole(RealRole realRole){
		this.realRole = realRole;
	}
	
	@Override
	public void find() {
		System.out.println("代理角色：操作真实角色之前！");
		if(realRole == null){
			realRole = new RealRole();
		}
		realRole.find();
		System.out.println("代理角色：操作真实角色之后！");
	}

}
